@import '../common/style/index.less';

@upload-add-color: var(--td-upload-add-color, @font-gray-3);
@upload-add-bg-color: var(--td-upload-add-bg-color, @bg-color-secondarycontainer);
@upload-radius: var(--td-upload-radius, @radius-default);
@upload-add-icon-font-size: var(--td-upload-add-icon-font-size, 56rpx);

.@{prefix}-upload {
  &__grid {
    &-content {
      padding: 0;
    }

    &-file {
      position: relative;
    }
  }

  &__add-icon {
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: @upload-add-icon-font-size;
    background-color: @upload-add-bg-color;
    color: @upload-add-color;
    border-radius: @upload-radius;

    &:only-child {
      display: flex;
    }
  }

  &__thumbnail {
    width: 100%;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
  }

  &__wrapper {
    position: relative;
    border-radius: @upload-radius;
    overflow: hidden;
  }

  &__close-btn {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40rpx;
    height: 40rpx;
    border-top-right-radius: @upload-radius;
    border-bottom-left-radius: @upload-radius;
    background-color: @font-gray-3;
  }

  &__progress {
    &-mask {
      position: absolute;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      background-color: @font-gray-3;
      display: flex;
      flex-direction: column;
      align-items: center;
      border-radius: @upload-radius;
      color: @font-white-1;
      padding: 32rpx 0;
    }

    &-text {
      font-size: 24rpx;
      line-height: 40rpx;
      margin-top: 8rpx;
    }

    &-loading {
      animation: spin infinite linear 0.6s;
    }
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
